package com.zang.blogz.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zang.blogz.model.output.ArchiveVO;
import com.zang.blogz.result.Result;
import com.zang.blogz.service.ArticleService;
import io.github.vampireachao.stream.core.optional.Opp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 橘贝贝
 * @Description: 归档模块
 * @DateTime: 2022/7/21 14:33
 **/
@RestController
@RequestMapping("/blogz/archive")
@Api(tags = "归档模块")
public class ArchiveController {

    @Autowired
    private ArticleService articleService;

    /**
     * 查询所有归档
     * @param pageNo 当前页
     * @param pageSize 当前页大小
     * @return
     */
    @GetMapping("/index/archive")
    public IPage<ArchiveVO> getArchiveInfo(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {


        return articleService.getListArchiveVo(pageNo, pageSize);

    }
}
